package signals

import (
	"go-ddd/internal/common/logs"
	"os"
	"os/signal"
	"syscall"
)

func WaitSignal(stop func()) {
	quit := make(chan os.Signal, 1)
	signal.Notify(quit, syscall.SIGINT, syscall.SIGTERM)
	<-quit
	logs.Infof("优雅退出服务...")
	// 优雅退出
	stop()

}
